<security:authorize ifAnyGranted="ROLE_CA,ROLE_CC,ROLE_SCA,ROLE_Booking">
<c:if test="${not empty loanRequest.id and loanRequest.phase!='draft' and loanRequest.phase!='dealer_submit'}">
  <div class="box box-danger box-solid">
    <div class="box-header">
      <h3 class="box-title"><fmt:message key="loanRequestDetail.suggestTitle"/></h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body" style="${empty loanRequest.rules?'':'height:300px;overflow-y:auto;'}">
      <table class="table table-bordered">
        <tbody>
        <c:forEach var="rule" items="${loanRequest.rules}">
          <tr>
            <th>
                <input type="hidden" value="/rule/${rule.url}?ruleId=${rule.id}&reqId=${loanRequest.id}"/>
                <c:choose>
                    <c:when test="${rule.url == 'related'}">
                        <a class="btn btn-xs ${fn:startsWith(rule.code, 'F')? 'btn-danger':'btn-primary'}">
                        <span class="open-related">${rule.code}</span></a>
                    </c:when>
                    <c:when test="${rule.url ==  'history'}">
                            <a class="btn btn-xs ${fn:startsWith(rule.code, 'F')? 'btn-danger':'btn-primary'}">
                        <span class="open-history">${rule.code}</span></a>
                    </c:when>
                    <c:otherwise>
                        <span class="${fn:startsWith(rule.code, 'F')? 'text-red':'text-light-blue'}">${rule.code}</span>
                    </c:otherwise>
                </c:choose>
              </th>
            <th class="${fn:startsWith(rule.code, 'F')? 'text-red':'text-light-blue'}"><c:out value="${rule.description}"></c:out></th>

          </tr>
        </c:forEach>
<c:if test="${empty loanRequest.rules}">
    No against rule found..
</c:if>
        </tbody>
      </table>
    </div>
    <!-- /.box-body -->
  </div>


    <div id="related" title="<fmt:message key="loanRequestDetail.action.relatedRecord"/>">
        <table class="table table-condensed" id="relatedList"></table>
    </div>
</c:if>
</security:authorize>